
-- config
select * from Nop_Setting where Value like '%yourstore.com%'
select * from Nop_

-- customer
select * from Nop_Customer
select * from Nop_Customer_CustomerRole_Mapping
select * from Nop_Customer c
inner join Nop_Address a
on c.CustomerID = a.CustomerID

-- order
select * from Nop_Order o
inner join Nop_Customer c
on o.CustomerId = c.CustomerId

select * from Nop_Report_Order

select * from Nop_Order o
inner join Nop_OrderProductVariant opv
on o.OrderID = opv.OrderID
inner join Nop_ProductVariant pv
on opv.ProductVariantID = pv.ProductVariantId
inner join Nop_Product p
on pv.ProductID = p.ProductId
where  o.OrderGUID='3BC9F044-871C-4407-A3F9-191E4042EBBD'

-- email config
update Nop_EmailAccount set Host='localhost', Password='empty' -- i'am using smtpForDev from codeplex
select * from Nop_EmailAccount
select SentOn from Nop_QueuedEmail

-- email queue
select * from Nop_QueuedMessage

-- message templates
select * from Nop_MessageTemplateLocalized tl
inner join Nop_MessageTemplate t
on t.MessageTemplateID = tl.MessageTemplateID
where t.Name in ('OrderPlaced.CustomerNotification','OrderPlaced.StoreOwnerNotification')

update Nop_MessageTemplateLocalized
set Body='<p><a href="%Store.URL%">%Store.Name%</a> <br />  <br />  Hello %Order.CustomerFullName%, <br />  Thanks for buying from <a href="%Store.URL%">%Store.Name%</a>. Below is the summary of the order. <br />  <br />  Order Number: %Order.OrderNumber%<br />  Order Details: <a target="_blank" href="%Order.OrderURLForCustomer%">%Order.OrderURLForCustomer%</a><br />  Date Ordered: %Order.CreatedOn%<br />  <br />  <br />  <br />  Billing Address<br />  %Order.BillingFirstName% %Order.BillingLastName%<br />  %Order.BillingAddress1%<br />  %Order.BillingCity% %Order.BillingZipPostalCode%<br />  %Order.BillingStateProvince% %Order.BillingCountry%<br />  <br />  <br />  <br />  Shipping Address<br />  %Order.ShippingFirstName% %Order.ShippingLastName%<br />  %Order.ShippingAddress1%<br />  %Order.ShippingCity% %Order.ShippingZipPostalCode%<br />  %Order.ShippingStateProvince% %Order.ShippingCountry%<br />  <br />  Shipping Method: %Order.ShippingMethod%  <br />  <br />  %Order.Product(s)%  <br /> <a href="%Store.URL%/report.axd.aspx?reportid=ORDER_SUMMARY&onr=%Order.OrderNumber%">Zusammenfassung als PDF herunterladen</a> </p>'
where MessageTemplateLocalizedID = 119

update Nop_MessageTemplateLocalized
set Body='<p><a href="%Store.URL%">%Store.Name%</a> <br />  <br />  %Order.CustomerFullName% (%Order.CustomerEmail%) has just placed an order from your store. Below is the summary of the order. <br />  <br />  Order Number: %Order.OrderNumber%<br />  Date Ordered: %Order.CreatedOn%<br />  <br />  <br />  <br />  Billing Address<br />  %Order.BillingFirstName% %Order.BillingLastName%<br />  %Order.BillingAddress1%<br />  %Order.BillingCity% %Order.BillingZipPostalCode%<br />  %Order.BillingStateProvince% %Order.BillingCountry%<br />  <br />  <br />  <br />  Shipping Address<br />  %Order.ShippingFirstName% %Order.ShippingLastName%<br />  %Order.ShippingAddress1%<br />  %Order.ShippingCity% %Order.ShippingZipPostalCode%<br />  %Order.ShippingStateProvince% %Order.ShippingCountry%<br />  <br />  Shipping Method: %Order.ShippingMethod%  <br />  <br />  %Order.Product(s)% <br /> <a href="%Store.URL%/repport.axd?reportid=ORDER_SUMMARY&onr=%Order.OrderNumber%">Zusammenfassung als PDF herunterladen</a> </p>'
where MessageTemplateLocalizedID = 120

-- reports
SELECT * FROM Nop_Report

INSERT Nop_Report 
(
	ReportId,
	Description,
	Configuration
)
VALUES
(
	'ORDER_SUMMARY',
	'Zusammenfasstung einer Bestellung',
	'<NopReport Id="ORDER_SUMMARY">
	  <Configuration ReportPath="reports/ordersummary.rdl">
		<Checks >
		  <Check Type="brevis.Nop.SDK.Checker.UserOrderMatch, brevis.Nop.SDK" />
		</Checks>
		<Parameters>
		  <Parameter Key="orderid" DataGetterType="brevis.Nop.SDK.ReportDataGetter.HttpContextQueryString, brevis.Nop.SDK">
			<GetMethodAttributes>
			  <GetMethodAttribute Value="orderid" Type="System.String" />
			</GetMethodAttributes>
		  </Parameter>
		</Parameters>
		<DataSets>
		  <DataSet Key="NopOrder" DataGetterType="brevis.Nop.SDK.ReportDataGetter.NopReportOrder, brevis.Nop.SDK" />
		</DataSets>
	  </Configuration>
	</NopReport>'
)

INSERT Nop_Report 
(
	ReportId,
	Description,
	Configuration
)
VALUES
(
'ORDERTEST',
'testreport zum zeigen',
'<NopReport Id="ORDERTEST">
  <Configuration ReportPath="reports/ordertest.rdl">
    <Checks />
    <Parameters>
      <Parameter Key="customerid" DataGetterType="brevis.Nop.SDK.ReportDataGetter.HttpContextQueryString, brevis.Nop.SDK">
        <GetMethodAttributes>
          <GetMethodAttribute Value="orderguid" Type="System.String" />
        </GetMethodAttributes>
      </Parameter>
    </Parameters>
    <DataSets>
      <DataSet Key="NopOrder" DataGetterType="brevis.Nop.SDK.ReportDataGetter.NopReportOrder, brevis.Nop.SDK" />
    </DataSets>
  </Configuration>
</NopReport>'
)

UPDATE Nop_Report
SET Configuration='<NopReport Id="TEST_QUERYSTRING">
  <Configuration ReportPath="reports/testquerystring.rdl">
    <Checks >
      <Check Type="brevis.Nop.SDK.Checker.OKTest, brevis.Nop.SDK" />
    </Checks>
    <Parameters>
      <Parameter Key="parameter1" DataGetterType="brevis.Nop.SDK.ReportDataGetter.HttpContextQueryString, brevis.Nop.SDK">
        <GetMethodAttributes>
          <GetMethodAttribute Value="p" Type="System.String" />
        </GetMethodAttributes>
      </Parameter>
    </Parameters>
    <DataSets />
  </Configuration>
</NopReport>'
WHERE ReportId='TEST_PARAMETER_QUERYSTRING'

UPDATE Nop_Report
SET Configuration=
'<NopReport Id="TEST_DATASET">
  <Configuration ReportPath="reports/testdatasets.rdl">
    <Checks >
      <Check Type="brevis.Nop.SDK.Checker.OKTest, brevis.Nop.SDK" />
    </Checks>
    <Parameters />
    <DataSets>
		<DataSet Key="Nop_Report_Order" DataGetterType="brevis.Nop.SDK.ReportDataGetter.NopReportOrder, brevis.Nop.SDK" />
    </DataSets>
  </Configuration>
</NopReport>' WHERE ReportId='TEST_DATASET'

UPDATE Nop_Report
SET Configuration=
'<NopReport Id="TEST_FILTEREDDATASET">
  <Configuration ReportPath="reports/testquerystringdatasets.rdl">
    <Checks />
     <Parameters>
      <Parameter Key="customerid" DataGetterType="brevis.Nop.SDK.ReportDataGetter.HttpContextQueryString, brevis.Nop.SDK">
        <GetMethodAttributes>
          <GetMethodAttribute Value="cid" Type="System.Int32" />
        </GetMethodAttributes>
      </Parameter>
    </Parameters>
    <DataSets>
		<DataSet Key="Nop_Report_CustomerAddress" DataGetterType="brevis.Nop.SDK.ReportDataGetter.NopReportCustomerAddress, brevis.Nop.SDK" />
    </DataSets>
  </Configuration>
</NopReport>' WHERE ReportId='TEST_FILTEREDDATASET'

UPDATE Nop_Report
SET Configuration=
'<NopReport Id="ORDERTEST">
  <Configuration ReportPath="reports/ordertest.rdl">
    <Checks />
    <Parameters>
      <Parameter Key="orderguid" DataGetterType="brevis.Nop.SDK.ReportDataGetter.HttpContextQueryString, brevis.Nop.SDK">
        <GetMethodAttributes>
          <GetMethodAttribute Value="orderguid" Type="System.String" />
        </GetMethodAttributes>
      </Parameter>
    </Parameters>
    <DataSets>
      <DataSet Key="NopOrder" DataGetterType="brevis.Nop.SDK.ReportDataGetter.NopReportOrder, brevis.Nop.SDK" />
    </DataSets>
  </Configuration>
</NopReport>' WHERE ReportId='ORDERTEST'

UPDATE Nop_Report
SET Configuration='<NopReport Id="ORDER_SUMMARY">
	  <Configuration ReportPath="reports/ordersummary.rdl">
		<Checks >
		  <Check Type="brevis.Nop.SDK.Checker.UserOrderMatch, brevis.Nop.SDK" />
		</Checks>
		<Parameters>
		  <Parameter Key="orderid" DataGetterType="brevis.Nop.SDK.ReportDataGetter.HttpContextQueryString, brevis.Nop.SDK">
			<GetMethodAttributes>
			  <GetMethodAttribute Value="orderid" Type="System.String" />
			</GetMethodAttributes>
		  </Parameter>
		</Parameters>
		<DataSets>
		  <DataSet Key="NopReportOrder" DataGetterType="brevis.Nop.SDK.ReportDataGetter.NopReportOrder, brevis.Nop.SDK" />
		</DataSets>
	  </Configuration>
	</NopReport>' WHERE ReportId = 'ORDER_SUMMARY'

